import http from '@/utils/request';

const userApi = {
	Login:() =>{//用户登录
		return http.get('/wx/v1/user/userLogin', {})
	},
	outLogin:(params) =>{//退出登录
		return http.get('/wx/v1/user/listUserByOpenId',{
			params
		})
	},
	getTenantList:(params) =>{
		return http.get("/wx/v1/sysTenant/listByUserName",{
			params
		})
	},
	Iphone:(params) =>{//手机号
		return http.get('/wx/v1/auth/getBSPhone',{
			params
		})
	},

	// 获取openid
	getOpenId:(params) => {
		return http.get('/wx/v1/auth/getBSOpenId',{params})
	},
	getByOpenId:(params)=>{//是否注册
	   return http.get('/wx/v1/user/checkoutUserRegister',{
		   params
	   })
	},
	toLogin:(data)=>{
		return http.post('/wx/v1/user/userLogin',data)
	},
	reLogin:(data)=>{
		return http.post('/wx/v1/user/userLogin',data)
	},
	msgSms:(data)=>{//发送短信验证码
		return http.post('/wx/v1/msg/sms',data)
	},
	getRoleList:()=>{//查询用户可用身份
		return http.get('/wx/v1/user/listUserByOpenId', {})
	},
	setUserPhone:(data)=>{//设置手机号
		return http.put('/wx/v1/user/setUserPhone',data)
	},
	getUserPhone:()=>{//查询用户手机号
	    return http.get('/wx/v1/user/getUserPhone', {})
	},
	getListWaitClearing:(params)=>{
		return http.get('/wx/v1/order/listWaitClearing',{params})
	},
	getUserByCode:(params)=>{
		return http.get('/wx/v1/user/getUserByCode',{params})
	},
	clearingOrder:(data)=>{
		return http.put('/wx/v1/business/clearingOrder',data)
	},
	getCardList:(data)=>{//银行卡列表
		return new Promise((resolve,reject)=>{
			resolve([{name:'中国银行'},{name:'中国银行'}])
		})
	},
	getWiteCard:(params)=>{//提现记录
		return http.get('/wx/v1/cashRecord/page',{
			params
		})
	},
	setcashState:(data)=>{//提现记录操作
		return http.put('/wx/v1/cashRecord/recordOperation',data)
	},
	modifyPassword:(data)=>{//修改用户密码
		return http.put('/wx/v1/user/modifyPassword',data)
	},
	setInfoAcc:(data)=>{//设置账户信息
		return http.post('/wx/v1/accountInfo/setInfo',data)
	},
	updateInfoAcc:(data)=>{//更新账户信息
		return http.post('/wx/v1/accountInfo/updateInfo',data)
	},
	accinfo:()=>{//查询账户信息
		return http.get('/wx/v1/accountInfo')
	},
	listBankCodeAll:()=>{//查询所有银行列表
		return http.get('/wx/v1/bankCode/listBankCode')
	},
	listBranchCode:(params)=>{//查询所有银行支行
		return http.get('/wx/v1/bankCode/pageBranchCode',{
			params
		})
	},
	cardListData:()=>{//列表
		return http.get('/wx/v1/accountInfo/listData')
	},
	addCard:(data)=>{//新增银行卡
		return http.post('/wx/v1/accountInfo/addBank',data)
	},
	bankSwitch:(data)=>{//银行卡设为默认卡
	    return http.post('/wx/v1/accountInfo/setYmDefault',data)
	},

	setAccountInfo:(data)=>{//设置资质信息
		return http.post('/wx/v1/accountInfo/setAccountInfo',data)
	},
	getAccountInfo:()=>{//获取资质信息
		return http.get('/wx/v1/accountInfo')
	},
	setYmAccount:(data)=>{//设置翼码信息
		return http.post('/wx/v1/accountInfo/setYmAccount',data)
	},
	accountInfoList:()=>{
		return http.get('/wx/v1/accountInfo/listData')
	},
	accountInfoItem:(params)=>{
		return http.get('/wx/v1/accountInfo/getYmAccount',{
			params
		})
	},
	getDataByNameType:(params)=>{//手机号获取卡信息
		return http.get('/wx/v1/accountInfo/getDataByNameType',{
			params
		})
	}
}

export default userApi
